------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\marko\Dropbox\07_LatinAmerica_Corruption_Paper\LAPOP\replication\paper-log.log
  log type:  text
 opened on:   6 May 2020, 19:18:56

. 
. ***************************************************************
. * Klasnja, Lupu, Tucker: 
. * "When Do Voters Sanction Corrupt Politicians?"
. * This do file replicates the results show in the main paper: 
. * Figures 1-3
. ***************************************************************
. 
. * for further details, see the readme.txt file in the replication archive
. * user-written command -coefplot- needed; type 'ssc install coefplot'
. * user-written plot scheme -plotplain- needed; type type 'net install gr0070'
. 
. *** Figure 1: Conjoint experiment results
. use analysis-data, clear
(�AmericasBarometer, LAPOP; created 22 Sep 2017; type: notes list)

. reg vote i.corrupttreat badeconomy##arias i.copartisan i.copsource2 i.female i.country [pw=weight1500], cl(uniq_id)
(sum of wgt is 8,355.07181036472)

Linear regression                               Number of obs     =      8,668
                                                F(12, 4333)       =      82.21
                                                Prob > F          =     0.0000
                                                R-squared         =     0.1103
                                                Root MSE          =      .4277

                                       (Std. Err. adjusted for 4,334 clusters in uniq_id)
-----------------------------------------------------------------------------------------
                        |               Robust
                   vote |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
------------------------+----------------------------------------------------------------
           corrupttreat |
                Bribes  |  -.3533974    .013401   -26.37   0.000    -.3796702   -.3271247
         Bribes common  |  -.3631275   .0134214   -27.06   0.000    -.3894404   -.3368146
       Bribes but jobs  |   -.264988   .0145094   -18.26   0.000    -.2934338   -.2365422
                        |
             badeconomy |
      Economy worsened  |  -.0676445   .0130233    -5.19   0.000    -.0931768   -.0421122
                1.arias |  -.0528361   .0153538    -3.44   0.001    -.0829373   -.0227349
                        |
       badeconomy#arias |
    Economy worsened#1  |   .0968282    .021476     4.51   0.000     .0547242    .1389322
                        |
             copartisan |
 Co-partisan candidate  |   .0775461   .0188731     4.11   0.000     .0405451     .114547
                        |
             copsource2 |
Out-partisan newspaper  |  -.0015192   .0103112    -0.15   0.883    -.0217345    .0186961
 Co-partisan newspaper  |   .0283579   .0130783     2.17   0.030     .0027178    .0539981
                        |
                 female |
                Female  |  -.0191172   .0092638    -2.06   0.039    -.0372791   -.0009553
                        |
                country |
                 Chile  |  -.0083276   .0090087    -0.92   0.355    -.0259894    .0093341
               Uruguay  |   .0021432   .0091276     0.23   0.814    -.0157516    .0200379
                        |
                  _cons |   .5735772   .0160463    35.75   0.000     .5421182    .6050361
-----------------------------------------------------------------------------------------

. coefplot, scheme(plotplain) xline(0, lcolor(black) lpattern(solid) lwidth(vthin)) ///
>         omitted baselevels graphregion(color(white)) ///
>         drop(_cons 0.arias 0.badeconomy#0.arias 0.badeconomy#1.arias 1.badeconomy#0.arias ///
>                 1.arias 1.badeconomy#1.arias 1.country 2.country 3.country) ///
>                 xtitle("Effect on Pr(Voting for candidate)") ///
>                 headings(1.corrupttreat = "{bf:Corruption}" ///
>                         0.badeconomy = "{bf:Economy} (incumbent only)" ///
>                         0.female = "{bf: Gender}" ///
>                         0.copartisan = "{bf:Partisanship}" ///
>                         0.copsource2 = "{bf:Information source}") ///
>                 coeflabels(, labsize(small)) mcolor(black) grid(glcolor(gs2)) ///
>                 msymbol(O) msize(medium)

. 
.                 
. *** Figure 2: Contextual and individual factors mitigating corruption voting
. use analysis-data, clear
(�AmericasBarometer, LAPOP; created 22 Sep 2017; type: notes list)

. mat ests = J(11,3,.)

. mat diffs = J(4,1,.)

. * corruption mitigators: prevalence and side benefits
. reg vote i.corrupttreat badeconomy##arias i.copartisan i.copsource2 i.female i.country [pw=weight1500], cl(uniq_id)
(sum of wgt is 8,355.07181036472)

Linear regression                               Number of obs     =      8,668
                                                F(12, 4333)       =      82.21
                                                Prob > F          =     0.0000
                                                R-squared         =     0.1103
                                                Root MSE          =      .4277

                                       (Std. Err. adjusted for 4,334 clusters in uniq_id)
-----------------------------------------------------------------------------------------
                        |               Robust
                   vote |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
------------------------+----------------------------------------------------------------
           corrupttreat |
                Bribes  |  -.3533974    .013401   -26.37   0.000    -.3796702   -.3271247
         Bribes common  |  -.3631275   .0134214   -27.06   0.000    -.3894404   -.3368146
       Bribes but jobs  |   -.264988   .0145094   -18.26   0.000    -.2934338   -.2365422
                        |
             badeconomy |
      Economy worsened  |  -.0676445   .0130233    -5.19   0.000    -.0931768   -.0421122
                1.arias |  -.0528361   .0153538    -3.44   0.001    -.0829373   -.0227349
                        |
       badeconomy#arias |
    Economy worsened#1  |   .0968282    .021476     4.51   0.000     .0547242    .1389322
                        |
             copartisan |
 Co-partisan candidate  |   .0775461   .0188731     4.11   0.000     .0405451     .114547
                        |
             copsource2 |
Out-partisan newspaper  |  -.0015192   .0103112    -0.15   0.883    -.0217345    .0186961
 Co-partisan newspaper  |   .0283579   .0130783     2.17   0.030     .0027178    .0539981
                        |
                 female |
                Female  |  -.0191172   .0092638    -2.06   0.039    -.0372791   -.0009553
                        |
                country |
                 Chile  |  -.0083276   .0090087    -0.92   0.355    -.0259894    .0093341
               Uruguay  |   .0021432   .0091276     0.23   0.814    -.0157516    .0200379
                        |
                  _cons |   .5735772   .0160463    35.75   0.000     .5421182    .6050361
-----------------------------------------------------------------------------------------

. margins, dydx(corrupttreat) post

Average marginal effects                        Number of obs     =      8,668
Model VCE    : Robust

Expression   : Linear prediction, predict()
dy/dx w.r.t. : 2.corrupttreat 3.corrupttreat 4.corrupttreat

----------------------------------------------------------------------------------
                 |            Delta-method
                 |      dy/dx   Std. Err.      t    P>|t|     [95% Conf. Interval]
-----------------+----------------------------------------------------------------
    corrupttreat |
         Bribes  |  -.3533974    .013401   -26.37   0.000    -.3796702   -.3271247
  Bribes common  |  -.3631275   .0134214   -27.06   0.000    -.3894404   -.3368146
Bribes but jobs  |   -.264988   .0145094   -18.26   0.000    -.2934338   -.2365422
----------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.

. mat tab = r(table)

. forval i = 2/4 {
  2.         mat ests[`i',1] = tab[1,`i']
  3.         mat ests[`i',2] = tab[5,`i']
  4.         mat ests[`i',3] = tab[6,`i']
  5.         }

. lincom 3.corrupttreat-2.corrupttreat

 ( 1)  - 2.corrupttreat + 3.corrupttreat = 0

------------------------------------------------------------------------------
             |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |  -.0097301    .011504    -0.85   0.398    -.0322839    .0128237
------------------------------------------------------------------------------

. mat diffs[1,1] = r(estimate)

. lincom 4.corrupttreat-2.corrupttreat

 ( 1)  - 2.corrupttreat + 4.corrupttreat = 0

------------------------------------------------------------------------------
             |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |   .0884094   .0127561     6.93   0.000     .0634008     .113418
------------------------------------------------------------------------------

. mat diffs[2,1] = r(estimate)

. * co-partisan bias
. reg vote i.corrupttreat##i.copartisan badeconomy##arias i.copsource2 i.female i.country [pw=weight1500], cl(uniq_id)
(sum of wgt is 8,355.07181036472)

Linear regression                               Number of obs     =      8,668
                                                F(15, 4333)       =      66.34
                                                Prob > F          =     0.0000
                                                R-squared         =     0.1110
                                                Root MSE          =     .42759

                                                      (Std. Err. adjusted for 4,334 clusters in uniq_id)
--------------------------------------------------------------------------------------------------------
                                       |               Robust
                                  vote |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------------------------------+----------------------------------------------------------------
                          corrupttreat |
                               Bribes  |  -.3462265   .0139115   -24.89   0.000    -.3735001   -.3189529
                        Bribes common  |     -.3582   .0139468   -25.68   0.000    -.3855428   -.3308572
                      Bribes but jobs  |  -.2561961   .0149986   -17.08   0.000    -.2856011   -.2267911
                                       |
                            copartisan |
                Co-partisan candidate  |   .1550649   .0416301     3.72   0.000     .0734486    .2366811
                                       |
               corrupttreat#copartisan |
         Bribes#Co-partisan candidate  |  -.1085931   .0552178    -1.97   0.049    -.2168482    -.000338
  Bribes common#Co-partisan candidate  |  -.0727644   .0548904    -1.33   0.185    -.1803776    .0348489
Bribes but jobs#Co-partisan candidate  |  -.1314282   .0597686    -2.20   0.028    -.2486053   -.0142512
                                       |
                            badeconomy |
                     Economy worsened  |  -.0676367   .0130133    -5.20   0.000    -.0931494    -.042124
                               1.arias |  -.0526438   .0153534    -3.43   0.001    -.0827443   -.0225432
                                       |
                      badeconomy#arias |
                   Economy worsened#1  |   .0966118   .0214637     4.50   0.000     .0545319    .1386916
                                       |
                            copsource2 |
               Out-partisan newspaper  |  -.0006011   .0103238    -0.06   0.954    -.0208411    .0196389
                Co-partisan newspaper  |   .0289511   .0130758     2.21   0.027     .0033158    .0545863
                                       |
                                female |
                               Female  |  -.0190311   .0092637    -2.05   0.040    -.0371927   -.0008694
                                       |
                               country |
                                Chile  |  -.0084767   .0090123    -0.94   0.347    -.0261455     .009192
                              Uruguay  |   .0021014   .0091422     0.23   0.818    -.0158219    .0200247
                                       |
                                 _cons |   .5677386   .0163004    34.83   0.000     .5357816    .5996957
--------------------------------------------------------------------------------------------------------

. margins, dydx(2.corrupttreat) at(copartisan = (0 1)) post

Average marginal effects                        Number of obs     =      8,668
Model VCE    : Robust

Expression   : Linear prediction, predict()
dy/dx w.r.t. : 2.corrupttreat

1._at        : copartisan      =           0

2._at        : copartisan      =           1

---------------------------------------------------------------------------------
                |            Delta-method
                |      dy/dx   Std. Err.      t    P>|t|     [95% Conf. Interval]
----------------+----------------------------------------------------------------
1.corrupttreat  |  (base outcome)
----------------+----------------------------------------------------------------
2.corrupttreat  |
            _at |
             1  |  -.3462265   .0139115   -24.89   0.000    -.3735001   -.3189529
             2  |  -.4548196   .0531942    -8.55   0.000    -.5591075   -.3505316
---------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.

. mat tab = r(table)

. forval i = 3/4 {
  2.         local j = `i'+3
  3.         mat ests[`j',1] = tab[1,`i']
  4.         mat ests[`j',2] = tab[5,`i']
  5.         mat ests[`j',3] = tab[6,`i']
  6.         }

. lincom _b[2.corrupttreat:2._at]-_b[2.corrupttreat:1._at]

 ( 1)  - [2.corrupttreat]1bn._at + [2.corrupttreat]2._at = 0

------------------------------------------------------------------------------
             |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |  -.1085931   .0552178    -1.97   0.049    -.2168482    -.000338
------------------------------------------------------------------------------

. mat diffs[3,1] = r(estimate)

. * justifiability of bribes
. reg vote i.corrupttreat##i.bribejust badeconomy##arias i.copartisan i.copsource2 i.female i.country [pw=weight1500], cl(uniq_id)
(sum of wgt is 8,256.80455803871)

Linear regression                               Number of obs     =      8,566
                                                F(16, 4282)       =      66.33
                                                Prob > F          =     0.0000
                                                R-squared         =     0.1162
                                                Root MSE          =      .4267

                                               (Std. Err. adjusted for 4,283 clusters in uniq_id)
-------------------------------------------------------------------------------------------------
                                |               Robust
                           vote |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------------------------+----------------------------------------------------------------
                   corrupttreat |
                        Bribes  |  -.3666128   .0142513   -25.72   0.000    -.3945528   -.3386728
                 Bribes common  |   -.367043   .0144461   -25.41   0.000    -.3953648   -.3387212
               Bribes but jobs  |   -.284107   .0154706   -18.36   0.000    -.3144375   -.2537766
                                |
                      bribejust |
                High tolerance  |   .0160294   .0299675     0.53   0.593    -.0427224    .0747812
                                |
         corrupttreat#bribejust |
         Bribes#High tolerance  |   .0846854   .0431845     1.96   0.050     .0000214    .1693495
  Bribes common#High tolerance  |   .0033493   .0409998     0.08   0.935    -.0770315    .0837301
Bribes but jobs#High tolerance  |   .1241313   .0452667     2.74   0.006      .035385    .2128776
                                |
                     badeconomy |
              Economy worsened  |  -.0682119   .0130512    -5.23   0.000     -.093799   -.0426249
                        1.arias |  -.0524429   .0154359    -3.40   0.001    -.0827054   -.0221804
                                |
               badeconomy#arias |
            Economy worsened#1  |   .0982962   .0215829     4.55   0.000     .0559827    .1406098
                                |
                     copartisan |
         Co-partisan candidate  |   .0793506   .0188633     4.21   0.000     .0423687    .1163325
                                |
                     copsource2 |
        Out-partisan newspaper  |  -.0043259   .0103424    -0.42   0.676    -.0246023    .0159505
         Co-partisan newspaper  |   .0249166   .0131384     1.90   0.058    -.0008415    .0506748
                                |
                         female |
                        Female  |  -.0192951   .0092958    -2.08   0.038    -.0375198   -.0010705
                                |
                        country |
                         Chile  |   -.010226   .0090496    -1.13   0.259    -.0279678    .0075159
                       Uruguay  |   .0011985    .009163     0.13   0.896    -.0167658    .0191628
                                |
                          _cons |   .5773991   .0167077    34.56   0.000     .5446433    .6101549
-------------------------------------------------------------------------------------------------

. margins, dydx(2.corrupttreat) at(bribejust = (0 1)) post

Average marginal effects                        Number of obs     =      8,566
Model VCE    : Robust

Expression   : Linear prediction, predict()
dy/dx w.r.t. : 2.corrupttreat

1._at        : bribejust       =           0

2._at        : bribejust       =           1

---------------------------------------------------------------------------------
                |            Delta-method
                |      dy/dx   Std. Err.      t    P>|t|     [95% Conf. Interval]
----------------+----------------------------------------------------------------
1.corrupttreat  |  (base outcome)
----------------+----------------------------------------------------------------
2.corrupttreat  |
            _at |
             1  |  -.3666128   .0142513   -25.72   0.000    -.3945528   -.3386728
             2  |  -.2819273   .0407705    -6.91   0.000    -.3618587    -.201996
---------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.

. mat tab = r(table)

. forval i = 3/4 {
  2.         local j = `i'+6
  3.         mat ests[`j',1] = tab[1,`i']
  4.         mat ests[`j',2] = tab[5,`i']
  5.         mat ests[`j',3] = tab[6,`i']
  6.         }

. lincom _b[2.corrupttreat:2._at]-_b[2.corrupttreat:1._at]

 ( 1)  - [2.corrupttreat]1bn._at + [2.corrupttreat]2._at = 0

------------------------------------------------------------------------------
             |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |   .0846854   .0431845     1.96   0.050     .0000214    .1693495
------------------------------------------------------------------------------

. mat diffs[4,1] = r(estimate)

. * creating the graph
. clear

. svmat ests
number of observations will be reset to 11
Press any key to continue, or Break to abort
number of observations (_N) was 0, now 11

. gen n = .
(11 missing values generated)

. for any 1.1 1.5 2 2.5 3.6 4 4.5 5.6 6 6.5 6.7 \ any 1 2 3 4 5 6 7 8 9 10 11: replace n = X in Y

->  replace n = 1.1 in 1
(1 real change made)

->  replace n = 1.5 in 2
(1 real change made)

->  replace n = 2 in 3
(1 real change made)

->  replace n = 2.5 in 4
(1 real change made)

->  replace n = 3.6 in 5
(1 real change made)

->  replace n = 4 in 6
(1 real change made)

->  replace n = 4.5 in 7
(1 real change made)

->  replace n = 5.6 in 8
(1 real change made)

->  replace n = 6 in 9
(1 real change made)

->  replace n = 6.5 in 10
(1 real change made)

->  replace n = 6.7 in 11
(1 real change made)

. svmat diffs

. gen n2 = .
(11 missing values generated)

. for any 1.75 2 4.25 6.25 \ any 1 2 3 4: replace n2 = X in Y

->  replace n2 = 1.75 in 1
(1 real change made)

->  replace n2 = 2 in 2
(1 real change made)

->  replace n2 = 4.25 in 3
(1 real change made)

->  replace n2 = 6.25 in 4
(1 real change made)

. tostring diffs1, gen(diffs_) force format(%9.3f)
diffs_ generated as str6
diffs_ was forced to string; some loss of information

. gen stars = "" in 1
(11 missing values generated)

. replace stars = "***" in 2
variable stars was str1 now str3
(1 real change made)

. replace stars = "**" in 3
(1 real change made)

. replace stars = "*" in 4
(1 real change made)

. egen diffs = concat(diffs_ stars)

. gen t = "Diff.: " in 1/4
(7 missing values generated)

. egen lab = concat(t diffs)

. forval i = 1/4 {
  2.         loc l`i' = lab in `i'
  3.         di "`l`i''"
  4.         }
Diff.: -0.010
Diff.: 0.088***
Diff.: -0.109**
Diff.: 0.085*

. twoway (rcap ests2 ests3 n, msize(0) lcol(black) horizontal) ///
>                 (scatter n ests1, mcol(black) msize(medium) msymbol(O)), ///
>                 legend(off) scheme(plotplain) ///
>                 ylabel(1.1 "{bf: Corruption}" 1.5 "Bribes" 2 "Bribes common" ///
>                                 2.5 "Bribes but jobs" 3.6 "{bf: Co-partisan bias}" ///
>                                 4 "Bribes & out-partisan candidate" 4.5 "Bribes & co-partisan candidate" ///
>                                 5.6 "{bf: Bribe tolerance}" 6 "Bribes & low tolerance" ///
>                                 6.5 "Bribes & high tolerance", labgap(6pt) noticks nogrid angle(0) labsize(small)) ytitle("") ///
>                 xscale(range(-0.6(.1)0)) xlabel(#4, glcolor(gs2)) xtitle("Effect on Pr(Voting for candidate)") ///
>                 yscale(reverse )  ytick(1.5 2 2.5 4 4.5 6 6.5, grid glcolor(gs2)) ///
>                 xline(0, lcolor(black) lpattern(dash) lwidth(vthin)) ///
>                 text(1.71 -.41 "`=ustrunescape("\u23A7")'" "`=ustrunescape("\u23A8")'" "`=ustrunescape("\u23A9")'" , size(small) color(black)) ///
>                 text(1.75 -.47 "`l1'", size(small)) ///
>                 text(1.9 -.2 "`=ustrunescape("\u23AB")'" "`=ustrunescape("\u23AC")'" "`=ustrunescape("\u23AD")'" , size(vlarge) color(black)) ///
>                 text(1.95 -.13 "`l2'", size(small)) ///
>                 text(4.23 -.3 "`=ustrunescape("\u23AB")'" "`=ustrunescape("\u23AC")'" "`=ustrunescape("\u23AD")'" , size(small) color(black)) ///
>                 text(4.25 -.24 "`l3'", size(small)) ///
>                 text(6.23 -.18 "`=ustrunescape("\u23AB")'" "`=ustrunescape("\u23AC")'" "`=ustrunescape("\u23AD")'" , size(small) color(black)) ///
>                 text(6.25 -.12 "`l4'", size(small)) 

. 
. 
. *** Figure 3: What conditions amplify the mitigating effect of side benefits?
. use analysis-data, clear
(�AmericasBarometer, LAPOP; created 22 Sep 2017; type: notes list)

. mat ests = J(13,3,.)

. mat diffs = J(6,1,.)

. * respondents' education
. reg vote i.corrupttreat##i.loed2 badeconomy##arias i.copartisan i.copsource2 i.female i.country [pw=weight1500], cl(uniq_id)
(sum of wgt is 8,355.07181036472)

Linear regression                               Number of obs     =      8,668
                                                F(16, 4333)       =      65.13
                                                Prob > F          =     0.0000
                                                R-squared         =     0.1144
                                                Root MSE          =      .4268

                                              (Std. Err. adjusted for 4,334 clusters in uniq_id)
------------------------------------------------------------------------------------------------
                               |               Robust
                          vote |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------------------------+----------------------------------------------------------------
                  corrupttreat |
                       Bribes  |  -.4594453   .0278717   -16.48   0.000    -.5140881   -.4048026
                Bribes common  |  -.4881154   .0283177   -17.24   0.000    -.5436327   -.4325982
              Bribes but jobs  |  -.4203397   .0304641   -13.80   0.000     -.480065   -.3606144
                               |
                         loed2 |
                Low education  |  -.1244136   .0243211    -5.12   0.000    -.1720954   -.0767318
                               |
            corrupttreat#loed2 |
         Bribes#Low education  |    .133302   .0317575     4.20   0.000     .0710411     .195563
  Bribes common#Low education  |   .1572822   .0321129     4.90   0.000     .0943244    .2202399
Bribes but jobs#Low education  |    .194445   .0345698     5.62   0.000     .1266705    .2622195
                               |
                    badeconomy |
             Economy worsened  |  -.0674586   .0129951    -5.19   0.000    -.0929356   -.0419817
                       1.arias |  -.0525729    .015327    -3.43   0.001    -.0826216   -.0225242
                               |
              badeconomy#arias |
           Economy worsened#1  |   .0957692   .0214299     4.47   0.000     .0537557    .1377827
                               |
                    copartisan |
        Co-partisan candidate  |   .0794764   .0188686     4.21   0.000     .0424844    .1164685
                               |
                    copsource2 |
       Out-partisan newspaper  |   -.001638   .0102802    -0.16   0.873    -.0217925    .0185165
        Co-partisan newspaper  |   .0284233     .01306     2.18   0.030      .002819    .0540277
                               |
                        female |
                       Female  |  -.0195714    .009245    -2.12   0.034    -.0376963   -.0014464
                               |
                       country |
                        Chile  |  -.0075427   .0090039    -0.84   0.402     -.025195    .0101096
                      Uruguay  |   .0020141   .0091108     0.22   0.825    -.0158477    .0198758
                               |
                         _cons |   .6727574   .0248923    27.03   0.000     .6239558    .7215591
------------------------------------------------------------------------------------------------

. local j = 2

. foreach i in 2 3 {
  2.         lincom `j'.corrupttreat
  3.         mat ests[`i',1] = r(estimate)
  4.         mat ests[`i',2] = r(lb)
  5.         mat ests[`i',3] = r(ub)
  6.         local j = `j' + 2
  7.         }

 ( 1)  2.corrupttreat = 0

------------------------------------------------------------------------------
        vote |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |  -.4594453   .0278717   -16.48   0.000    -.5140881   -.4048026
------------------------------------------------------------------------------

 ( 1)  4.corrupttreat = 0

------------------------------------------------------------------------------
        vote |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |  -.4203397   .0304641   -13.80   0.000     -.480065   -.3606144
------------------------------------------------------------------------------

. lincom 4.corrupttreat-2.corrupttreat

 ( 1)  - 2.corrupttreat + 4.corrupttreat = 0

------------------------------------------------------------------------------
        vote |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |   .0391056   .0260465     1.50   0.133    -.0119588    .0901701
------------------------------------------------------------------------------

. mat diffs[1,1] = r(estimate)

. lincom 2.corrupttreat+2.corrupttreat#1.loed2

 ( 1)  2.corrupttreat + 2.corrupttreat#1.loed2 = 0

------------------------------------------------------------------------------
        vote |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |  -.3261433   .0152082   -21.45   0.000    -.3559591   -.2963275
------------------------------------------------------------------------------

. mat ests[5,1] = r(estimate)

. mat ests[5,2] = r(lb)

. mat ests[5,3] = r(ub)

. lincom 4.corrupttreat+4.corrupttreat#1.loed2

 ( 1)  4.corrupttreat + 4.corrupttreat#1.loed2 = 0

------------------------------------------------------------------------------
        vote |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |  -.2258948   .0163614   -13.81   0.000    -.2579715    -.193818
------------------------------------------------------------------------------

. mat ests[6,1] = r(estimate)

. mat ests[6,2] = r(lb)

. mat ests[6,3] = r(ub)

. lincom 4.corrupttreat+4.corrupttreat#1.loed2-(2.corrupttreat+2.corrupttreat#1.loed2)

 ( 1)  - 2.corrupttreat + 4.corrupttreat - 2.corrupttreat#1.loed2 + 4.corrupttreat#1.loed2 = 0

------------------------------------------------------------------------------
        vote |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |   .1002485   .0145901     6.87   0.000     .0716445    .1288526
------------------------------------------------------------------------------

. mat diffs[2,1] = r(estimate)

. lincom 4.corrupttreat+4.corrupttreat#1.loed2-(2.corrupttreat+2.corrupttreat#1.loed2)-(4.corrupttreat-2.corrupttreat)

 ( 1)  - 2.corrupttreat#1.loed2 + 4.corrupttreat#1.loed2 = 0

------------------------------------------------------------------------------
        vote |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |   .0611429   .0298649     2.05   0.041     .0025925    .1196934
------------------------------------------------------------------------------

. mat diffs[3,1] = r(estimate)

. * respondents' wealth
. reg vote i.corrupttreat##i.lowealth badeconomy##arias i.copartisan i.copsource2 i.female i.country [pw=weight1500], cl(uniq_id)
(sum of wgt is 8,355.07181036472)

Linear regression                               Number of obs     =      8,668
                                                F(16, 4333)       =      64.47
                                                Prob > F          =     0.0000
                                                R-squared         =     0.1140
                                                Root MSE          =      .4269

                                           (Std. Err. adjusted for 4,334 clusters in uniq_id)
---------------------------------------------------------------------------------------------
                            |               Robust
                       vote |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
----------------------------+----------------------------------------------------------------
               corrupttreat |
                    Bribes  |  -.4102308   .0207106   -19.81   0.000    -.4508343   -.3696274
             Bribes common  |  -.4286157   .0207084   -20.70   0.000    -.4692148   -.3880167
           Bribes but jobs  |  -.3515039    .022452   -15.66   0.000    -.3955214   -.3074864
                            |
                   lowealth |
                Low wealth  |  -.1064546    .020212    -5.27   0.000    -.1460804   -.0668287
                            |
      corrupttreat#lowealth |
         Bribes#Low wealth  |   .0965514    .027083     3.57   0.000     .0434548    .1496479
  Bribes common#Low wealth  |   .1112908   .0271219     4.10   0.000      .058118    .1644636
Bribes but jobs#Low wealth  |   .1452486   .0293066     4.96   0.000     .0877928    .2027045
                            |
                 badeconomy |
          Economy worsened  |  -.0669241   .0130084    -5.14   0.000    -.0924271   -.0414211
                    1.arias |  -.0524915   .0153401    -3.42   0.001     -.082566    -.022417
                            |
           badeconomy#arias |
        Economy worsened#1  |   .0956775   .0214441     4.46   0.000     .0536361    .1377188
                            |
                 copartisan |
     Co-partisan candidate  |   .0778338   .0189703     4.10   0.000     .0406422    .1150254
                            |
                 copsource2 |
    Out-partisan newspaper  |  -.0014873   .0102901    -0.14   0.885    -.0216611    .0186865
     Co-partisan newspaper  |   .0278001   .0130946     2.12   0.034     .0021281    .0534722
                            |
                     female |
                    Female  |  -.0192977   .0092489    -2.09   0.037    -.0374303   -.0011652
                            |
                    country |
                     Chile  |  -.0069381   .0090106    -0.77   0.441    -.0246036    .0107273
                   Uruguay  |   .0027358   .0091111     0.30   0.764    -.0151265    .0205982
                            |
                      _cons |   .6354391    .019698    32.26   0.000     .5968209    .6740573
---------------------------------------------------------------------------------------------

. local j = 2

. foreach i in 8 9 {
  2.         lincom `j'.corrupttreat
  3.         mat ests[`i',1] = r(estimate)
  4.         mat ests[`i',2] = r(lb)
  5.         mat ests[`i',3] = r(ub)
  6.         local j = `j' + 2
  7.         }

 ( 1)  2.corrupttreat = 0

------------------------------------------------------------------------------
        vote |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |  -.4102308   .0207106   -19.81   0.000    -.4508343   -.3696274
------------------------------------------------------------------------------

 ( 1)  4.corrupttreat = 0

------------------------------------------------------------------------------
        vote |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |  -.3515039    .022452   -15.66   0.000    -.3955214   -.3074864
------------------------------------------------------------------------------

. lincom 4.corrupttreat-2.corrupttreat

 ( 1)  - 2.corrupttreat + 4.corrupttreat = 0

------------------------------------------------------------------------------
        vote |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |   .0587269   .0197959     2.97   0.003     .0199169     .097537
------------------------------------------------------------------------------

. mat diffs[4,1] = r(estimate)

. lincom 2.corrupttreat+2.corrupttreat#1.lowealth

 ( 1)  2.corrupttreat + 2.corrupttreat#1.lowealth = 0

------------------------------------------------------------------------------
        vote |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |  -.3136795   .0174513   -17.97   0.000     -.347893    -.279466
------------------------------------------------------------------------------

. mat ests[11,1] = r(estimate)

. mat ests[11,2] = r(lb)

. mat ests[11,3] = r(ub)

. lincom 4.corrupttreat+4.corrupttreat#1.lowealth

 ( 1)  4.corrupttreat + 4.corrupttreat#1.lowealth = 0

------------------------------------------------------------------------------
        vote |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |  -.2062553   .0188461   -10.94   0.000    -.2432033   -.1693073
------------------------------------------------------------------------------

. mat ests[12,1] = r(estimate)

. mat ests[12,2] = r(lb)

. mat ests[12,3] = r(ub)

. lincom 4.corrupttreat+4.corrupttreat#1.lowealth-(2.corrupttreat+2.corrupttreat#1.lowealth)

 ( 1)  - 2.corrupttreat + 4.corrupttreat - 2.corrupttreat#1.lowealth + 4.corrupttreat#1.lowealth = 0

------------------------------------------------------------------------------
        vote |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |   .1074242   .0166639     6.45   0.000     .0747545    .1400939
------------------------------------------------------------------------------

. mat diffs[5,1] = r(estimate)

. lincom 4.corrupttreat+4.corrupttreat#1.lowealth-(2.corrupttreat+2.corrupttreat#1.lowealth)-(4.corrupttreat-2.corrupttreat)

 ( 1)  - 2.corrupttreat#1.lowealth + 4.corrupttreat#1.lowealth = 0

------------------------------------------------------------------------------
        vote |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |   .0486973   .0258826     1.88   0.060    -.0020458    .0994404
------------------------------------------------------------------------------

. mat diffs[6,1] = r(estimate)

. * creating the graph
. clear

. svmat ests
number of observations will be reset to 13
Press any key to continue, or Break to abort
number of observations (_N) was 0, now 13

. gen n = .
(13 missing values generated)

. for any 1.1 1.5 2 3.1 3.5 4 5.6 6 6.5 7.6 8 8.5 8.7 \ any 1 2 3 4 5 6 7 8 9 10 11 12 13: replace n = X in Y

->  replace n = 1.1 in 1
(1 real change made)

->  replace n = 1.5 in 2
(1 real change made)

->  replace n = 2 in 3
(1 real change made)

->  replace n = 3.1 in 4
(1 real change made)

->  replace n = 3.5 in 5
(1 real change made)

->  replace n = 4 in 6
(1 real change made)

->  replace n = 5.6 in 7
(1 real change made)

->  replace n = 6 in 8
(1 real change made)

->  replace n = 6.5 in 9
(1 real change made)

->  replace n = 7.6 in 10
(1 real change made)

->  replace n = 8 in 11
(1 real change made)

->  replace n = 8.5 in 12
(1 real change made)

->  replace n = 8.7 in 13
(1 real change made)

. svmat diffs

. gen n2 = .
(13 missing values generated)

. for any 1.75 3.75 2.75 6.25 8.25 7.25 \ any 1 2 3 4 5 6: replace n2 = X in Y

->  replace n2 = 1.75 in 1
(1 real change made)

->  replace n2 = 3.75 in 2
(1 real change made)

->  replace n2 = 2.75 in 3
(1 real change made)

->  replace n2 = 6.25 in 4
(1 real change made)

->  replace n2 = 8.25 in 5
(1 real change made)

->  replace n2 = 7.25 in 6
(1 real change made)

. tostring diffs1, gen(diffs_) force format(%9.3f)
diffs_ generated as str5
diffs_ was forced to string; some loss of information

. gen stars = "" in 1
(13 missing values generated)

. replace stars = "***" in 2
variable stars was str1 now str3
(1 real change made)

. replace stars = "**" in 3
(1 real change made)

. replace stars = "***" in 4
(1 real change made)

. replace stars = "***" in 5
(1 real change made)

. replace stars = "*" in 6
(1 real change made)

. egen diffs = concat(diffs_ stars)

. gen t = "Diff.: " in 1/6
(7 missing values generated)

. egen lab = concat(t diffs)

. forval i = 1/6 {
  2.         loc l`i' = lab in `i'
  3.         di "`l`i''"
  4.         }
Diff.: 0.039
Diff.: 0.100***
Diff.: 0.061**
Diff.: 0.059***
Diff.: 0.107***
Diff.: 0.049*

. twoway (rcap ests2 ests3 n, msize(0) lcol(black) horizontal) ///
>                 (scatter n ests1, mcol(black) msize(medium) msymbol(O)), ///
>                 legend(off) scheme(plotplain) ///
>                 ylabel(1.1 "{bf: High education}" 1.5 "Bribes" 2 "Bribes but jobs" ///
>                                 3.1 "{bf: Low education}" 3.5 "Bribes" 4 "Bribes but jobs" ///
>                                 5.6 "{bf: High wealth}" 6 "Bribes" 6.5 "Bribes but jobs" ///
>                                 7.6 "{bf: Low wealth}" 8 "Bribes" 8.5 "Bribes but jobs", ///
>                                 labgap(5pt) noticks nogrid angle(0) labsize(small)) ytitle("") ///
>                 xscale(range(-0.6(.1).1)) xlabel(#6, glcolor(gs2)) xtitle("Effect on Pr(Voting for candidate)") ///
>                 yscale(reverse )  ytick(1.5 2 3.5 4 6 6.5 8 8.5, grid glcolor(gs2)) ///
>                 xline(0, lcolor(black) lpattern(dash) lwidth(vthin)) ///
>                 text(1.73 -.33 "`=ustrunescape("\u23AB")'" "`=ustrunescape("\u23AC")'" "`=ustrunescape("\u23AD")'" , size(small) color(black)) ///
>                 text(1.75 -.27 "`l1'", size(small)) ///
>                 text(3.73 -.17 "`=ustrunescape("\u23AB")'" "`=ustrunescape("\u23AC")'" "`=ustrunescape("\u23AD")'" , size(small) color(black)) ///
>                 text(3.75 -.10 "`l2'", size(small)) ///
>                 text(2.63 .025 "`=ustrunescape("\u23AB")'" "`=ustrunescape("\u23AC")'" "`=ustrunescape("\u23AD")'" , size(vhuge) color(black)) ///
>                 text(2.79 .115 "`l3'", size(medium)) ///
>                 text(6.23 -.29 "`=ustrunescape("\u23AB")'" "`=ustrunescape("\u23AC")'" "`=ustrunescape("\u23AD")'" , size(small) color(black)) ///
>                 text(6.25 -.22 "`l4'", size(small)) ///
>                 text(8.23 -.15 "`=ustrunescape("\u23AB")'" "`=ustrunescape("\u23AC")'" "`=ustrunescape("\u23AD")'" , size(small) color(black)) ///
>                 text(8.25 -.08 "`l5'", size(small)) ///
>                 text(7.13 .025 "`=ustrunescape("\u23AB")'" "`=ustrunescape("\u23AC")'" "`=ustrunescape("\u23AD")'" , size(vhuge) color(black)) ///
>                 text(7.29 .115 "`l6'", size(medium)) yline(5, lpattern(solid) lcolor(gray) lwidth(thin))

. 
. 
. graph drop _all

. 
. log close
      name:  <unnamed>
       log:  C:\Users\marko\Dropbox\07_LatinAmerica_Corruption_Paper\LAPOP\replication\paper-log.log
  log type:  text
 closed on:   6 May 2020, 19:19:03
------------------------------------------------------------------------------------------------------------------------------------------------------------
